<template>
  <div>
    <!-- 面包屑导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/userInfo/userInfo' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path: '/rootManage/rootManage' }">房间管理</el-breadcrumb-item>
      <el-breadcrumb-item>房间流水</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 流水内容 -->
    <div class="table">
      <el-table :data="listData" highlight-current-row v-loading="loading" border stripe element-loading-text="拼命加载中"
        style="width: 100%" :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
        <el-table-column prop="showCode" label="房间号" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="liveTitle" label="房间标题" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="title" label="礼物" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="createTime" label="时间" show-overflow-tooltip>
        </el-table-column>
      </el-table>
    </div>

    <!-- 分页组件 -->
    <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>
  </div>
</template>

<script>
import { rootTurnoverList } from "@/api/root";
import Pagination from "../../components/Pagination";
export default {
  data() {
    return {
      loading: false, //是显示加载
      listData: [], //用户数据
      // 分页参数
      pageparm: {
        current: 1,
        size: 10,
        total: 10,
      },
    };
  },
  // 注册组件
  components: {
    Pagination,
  },
  /**
   * 数据发生改变
   */

  /**
   * 创建完毕
   */
  created() {
    this.getdata();
  },

  /**
   * 里面的方法只有被调用才会执行
   */
  methods: {
    // 获取公司列表
    getdata(data) {
      this.loading = true;

      rootTurnoverList(this.pageparm).then((res) => {
        this.listData = res.data.data;
        this.pageparm.total = Number(res.data.total);

        this.loading = false;
      });
    },
    // 分页插件事件
    callFather(parm) {
      this.pageparm.current = parm.currentPage || 1;
      this.pageparm.size = parm.pageSize || 10;
      this.getdata();
    },
  },
};
</script>

<style scoped>
.user-search {
  margin-top: 20px;
}

.userRole {
  width: 100%;
}

.table {
  padding: 20px 0;
  box-sizing: border-box;
}
</style>

 
 